package com.jmb.api.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;


@TableName(value ="t_data_factory")
@Data
public class DataFactory extends BaseEntity {


    /**
     * 数据工厂名称
     */
    @Size(message = "名称长度不能超过100")
    @TableField(value = "name")
    @Schema(description = "数据工厂名称")
    private String name;

    /**
     * 类型 0SQL 1接口 2ui
     */
    @Schema(description = "类型 0SQL 1接口 2ui")
    @NotNull(message = "类型不能为空")
    @Min(value = 0, message = "类型只能为0~2")
    @Max(value = 2, message = "类型只能为0~2")
    @TableField(value = "type")
    private Integer type;

    /**
     * 执行次数
     */
    @Schema(description = "执行次数")
    @Min(value = 1, message = "执行次数只能为1~1000")
    @Max(value = 1000, message = "执行次数只能为1~1000")
    @TableField(value = "times")
    private Integer times;

    /**
     * 遇到错误停止运行 0是1否
     */
    @Schema(description = "遇到错误停止运行 0是1否")
    @NotNull(message = "失败重试不能为空")
    @Min(value = 0, message = "失败重试只能为0~1")
    @Max(value = 1, message = "失败重试只能为0~1")
    @TableField(value = "failed_stop")
    private Integer failedStop;

    /**
     * 0dev1test2stg3prod4debug
     */
    @Schema(description = "运行环境")
    @Min(value = 0, message = "SQL运行环境只能为0~4")
    @Max(value = 4, message = "SQL运行环境只能为0~4")
    @TableField(value = "sql_run_dev")
    private Integer sqlRunDev;

    /**
     * 数据源编号
     */
    @Schema(description = "数据源编号")
    @TableField(value = "sql_db_id")
    private Integer sqlDbId;

    /**
     * sql语句
     */
    @Size(message = "sql语句")
    @TableField(value = "sql_str")
    private String sqlStr;

    /**
     * 接口用例编号
     */

    @Schema(description = "接口用例编号")
    @TableField(value = "interface_suite_id")
    private Integer interfaceSuiteId;

    /**
     * ui用例编号
     */
    @Schema(description = "ui用例编号")
    @TableField(value = "ui_suite_id")
    private Integer uiSuiteId;


    /**
     * 执行方式 0并行1串行
     */
    @Schema(description = "执行方式 0并行1串行")
    @NotNull(message = "执行方式不能为空")
    @Min(value = 0, message = "执行方式只能为0~1")
    @Max(value = 1, message = "执行方式只能为0~1")
    @TableField(value = "execute_type")
    private Integer executeType;

}